//
//  ZaiXianZhengJiViewController.m
//  tangshantongjiAPPFull
//
//  Created by yuntai on 2018/4/23.
//  Copyright © 2018年 yuntai. All rights reserved.
//

#import "ZaiXianZhengJiViewController.h"

@interface ZaiXianZhengJiViewController ()
@property (weak, nonatomic) IBOutlet IQTextView *textfiled;
@property (weak, nonatomic) IBOutlet UIButton *sureBtn;

@end

@implementation ZaiXianZhengJiViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.
    self.view.backgroundColor = kBGColor;
    self.textfiled.layer.cornerRadius = 5.f;
    self.textfiled.layer.masksToBounds = YES;
    self.sureBtn.layer.cornerRadius = 5.f;
    self.sureBtn.layer.masksToBounds = YES;
    self.textfiled.placeholder = @"请输入您的意见~";
}
- (IBAction)sureBtnAction:(UIButton *)sender {
    if(self.textfiled.text.length && ![self.textfiled.text isEqualToString:@""]){
        [self getdata];
    }else{
        [HUDManager showWarningWithText:@"请输入您的意见"];
    }
}

- (void)getdata{
    
    NSMutableDictionary *params = [NSMutableDictionary dictionary];
    [params setValue:kTokenID forKey:@"token"];
    [params setValue:self.textfiled.text forKey:@"content"];
    
    [NetWork PostNetWorkWithUrl:@"api/online/save.ajax" with:params successBlock:^(NSDictionary *dic) {
        
        [HUDManager showWarningWithText:dic[@"message"]];
        [self.navigationController popViewControllerAnimated:YES];
        
    } FailureBlock:^(NSString *msg) {
       
        [HUDManager showWarningWithText:msg];
        
        
    } errorBlock:^(id error) {
        
    }];
    
}
@end
